package com.cxrj.zhsq.propertyManage.controller;

import java.util.Map;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.cxrj.zhsq.propertyManage.entity.Release;
import com.cxrj.zhsq.propertyManage.service.ReleaseService;

@Controller
@RequestMapping("/release")
public class ReleaseController {
	
	@Resource
	private ReleaseService releaseService;
	
	/**
	 * 分页诉求
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "selectReleasePage", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	@ResponseBody
	public Map<String, Object> selectReleasePage(HttpServletRequest request,HttpServletResponse response){
		return releaseService.selectReleasePage(request,response);
	}
	
	/**
	 * 根据Id查询
	 * @param appealId
	 * @return
	 */
	@RequestMapping(value = "selectById", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	@ResponseBody
	public Map<String, Object> selectById(String appealId,HttpServletRequest request){
		return releaseService.selectById(appealId,request);
	}
	/**
	 * 反馈
	 * @param release
	 * @return
	 */
	@RequestMapping("updateRelease")
	@ResponseBody
	public Map<String, Object> updateRelease(Release release){
		
		return releaseService.updateRelease(release);
	}
	
	/**
	 * 删除
	 * @param appealId
	 * @return
	 */
	@RequestMapping("deleteRelease")
	@ResponseBody
	public Map<String, Object> deleteRelease(String appealId, HttpServletRequest request,HttpServletResponse response){
		
		return releaseService.deleteRelease(appealId,request,response);
		
	}
}
